package cmd;

import java.io.*;

public class runBat {

    /**
     * @param args
     */
    public static void main(String[] args) {

        String cc="sql.exe \"host='hubb.top' port='1432' dbname='hhdb' user='dba' password='hhdb2022' \"";
        System.out.println(cc);
        String path1 = "cmd /c start "; //该bat文件保存在项目目录下，所以无需写出完整路径，如果文件不在项目目录下则需要直接写出文件路径

        String path = "rundb.bat";

        try {
            Process process = Runtime.getRuntime().exec("D:\\hu_workspace\\file_mgr\\dist_hhdesk\\upgrade.exe");
            InputStream ins = process.getInputStream();
            byte[] b1 = new byte[1024];
            int len = -1;
            while((len=ins.read(b1)) != -1){
                System.out.println(new String(b1,0,len,"gbk"));
            }

        } catch (IOException e) {
            e.printStackTrace();
        }


    }



}